package xyz.jangle.action;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import xyz.jangle.model.BsUser;
import xyz.jangle.service.BsUserService;

@Controller
@RequestMapping("/bsUserCtrl")
public class BsUserCtrl {

	@Autowired
	private BsUserService bsUserService;

	@RequestMapping("/insert.ctrl")
	@ResponseBody
	public Map<String, Object> insert(BsUser record) {
		return bsUserService.insertOrUpdate(record);
	}

	@RequestMapping("/deleteByPrimaryKey.ctrl")
	@ResponseBody
	public Map<String, Object> deleteByPrimaryKey(BsUser record) {
		return bsUserService.deleteByPrimaryKey(record);
	}

	@RequestMapping("/selectPage.ctrl")
	@ResponseBody
	public Map<String, Object> selectPage(BsUser record) {
		return bsUserService.selectPage(record);
	}

	@RequestMapping("/selectByPrimaryKey.ctrl")
	@ResponseBody
	public Map<String, Object> selectByPrimaryKey(BsUser record) {
		return bsUserService.selectByPrimaryKey(record);
	}

	@RequestMapping("/batchDeleteByPrimaryKey.ctrl")
	@ResponseBody
	public Map<String, Object> batchDeleteByPrimaryKey(BsUser record) {
		return bsUserService.batchDeleteByPrimaryKey(record);
	}

	@RequestMapping("login")
	@ResponseBody
	public Map<String, Object> login(@RequestParam(required = false) String code,
			@RequestParam(required = false) String password) {
		return bsUserService.login(code, password);
	}
	@RequestMapping("logout")
	@ResponseBody
	public Map<String, Object> logout() {
		return bsUserService.logout();
	}
	@RequestMapping("status")
	@ResponseBody
	public Map<String, Object> status() {
		return bsUserService.status();
	}
	@RequestMapping("valid")
	@ResponseBody
	public Map<String, Object> valid(@RequestParam(required = false) String code) {
		return bsUserService.valid(code);
	}

}
